package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.IcPartyOrganizationsMapper;
import com.ruoyi.system.domain.IcPartyOrganizations;
import com.ruoyi.system.service.IIcPartyOrganizationsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 党团组织Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-10
 */
@Service
public class IcPartyOrganizationsServiceImpl implements IIcPartyOrganizationsService 
{
    @Autowired
    private IcPartyOrganizationsMapper icPartyOrganizationsMapper;

    /**
     * 查询党团组织
     * 
     * @param orgId 党团组织主键
     * @return 党团组织
     */
    @Override
    public IcPartyOrganizations selectIcPartyOrganizationsByOrgId(Long orgId)
    {
        return icPartyOrganizationsMapper.selectIcPartyOrganizationsByOrgId(orgId);
    }

    /**
     * 查询党团组织列表
     * 
     * @param icPartyOrganizations 党团组织
     * @return 党团组织
     */
    @Override
    public List<IcPartyOrganizations> selectIcPartyOrganizationsList(IcPartyOrganizations icPartyOrganizations)
    {
        return icPartyOrganizationsMapper.selectIcPartyOrganizationsList(icPartyOrganizations);
    }

    /**
     * 新增党团组织
     * 
     * @param icPartyOrganizations 党团组织
     * @return 结果
     */
    @Override
    public int insertIcPartyOrganizations(IcPartyOrganizations icPartyOrganizations)
    {
        icPartyOrganizations.setCreateTime(DateUtils.getNowDate());
        return icPartyOrganizationsMapper.insertIcPartyOrganizations(icPartyOrganizations);
    }

    /**
     * 修改党团组织
     * 
     * @param icPartyOrganizations 党团组织
     * @return 结果
     */
    @Override
    public int updateIcPartyOrganizations(IcPartyOrganizations icPartyOrganizations)
    {
        icPartyOrganizations.setUpdateTime(DateUtils.getNowDate());
        return icPartyOrganizationsMapper.updateIcPartyOrganizations(icPartyOrganizations);
    }

    /**
     * 批量删除党团组织
     * 
     * @param orgIds 需要删除的党团组织主键
     * @return 结果
     */
    @Override
    public int deleteIcPartyOrganizationsByOrgIds(String orgIds)
    {
        return icPartyOrganizationsMapper.deleteIcPartyOrganizationsByOrgIds(Convert.toStrArray(orgIds));
    }

    /**
     * 删除党团组织信息
     * 
     * @param orgId 党团组织主键
     * @return 结果
     */
    @Override
    public int deleteIcPartyOrganizationsByOrgId(Long orgId)
    {
        return icPartyOrganizationsMapper.deleteIcPartyOrganizationsByOrgId(orgId);
    }
}
